<?php

class Guestbook extends CActiveRecord {
	public static function model($className = __CLASS__) {
		return parent::model ( $className );
	}
	
	public function tableName() {
		return '{{guestbook}}';
	}
	
	public function rules() {
		return array (
			
			array (
				
				'gid,type_id', 
				'required' 
			), 
			array (
				
				'username,sex,qq,tel,email,message,ip,addtime,remess,retime,is_dis,type,state,level,uid', 
				'safe' 
			) 
		);
	}
	public function relations() {
		return array(
		'Line'=>array(self::BELONGS_TO, 'Line', 'type_id'),
		);
	}
	public function attributeLabels() {
		return array (
			
			'gid' => 'gid', 
			'type_id' => 'type_id', 
			'username' => 'session_data', 
			'sex' => 'sex', 
			'qq' => 'qq', 
			'tel' => 'tel', 
			'email' => 'email', 
			'message' => 'message', 
			'ip' => 'ip', 
			'addtime' => 'addtime', 
			'remess' => 'remess', 
			'retime' => 'retime', 
			'is_dis' => 'is_dis', 
			'type' => 'type', 
			'state' => 'state', 
			'level' => 'level' 
		);
	}
}